<template>
  <div>
    <h1 style="font-size: 30px; font-weight: 600">电影详情页</h1>
      <img :src="detail.pic" alt="" />
      <h1 style="font-size: 20px; font-weight: 600">{{ detail.title }}</h1>
      <p>{{ detail.slogo }}</p>
      <p>评分：{{ detail.raiting }}</p>
      <p>{{ detail.labels}}</p>
    <button @click="$router.back()">跳转回首页</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      detail: [],
    };
  },
  mounted() {
    // console.log(this.$route.params);
    var { id } = this.$route.params;
    console.log(id);
    this.$http(`http://47.108.197.28:4000/api/movieDetail?id=${id}`).then(
      (res) => {
        console.log(res.data.res);
        this.detail = res.data.res[0];
      }
    );
  },
};
</script>

<style>
</style>